/**
 * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
/*
 Copyright 2013 jQuery Foundation and other contributors
 Released under the MIT license.
 http://jquery.org/license
*/
define(["ojs/ojcore","jquery","ojs/ojcomponentcore","hammerjs","ojs/ojpagingtabledatasource","ojs/ojinputtext","ojs/ojjquery-hammer"],function(a,g,b,c){(function(){a.Ra("oj.ojPagingControl",g.oj.baseComponent,{version:"1.0.0",defaultElement:"\x3cdiv\x3e",widgetEventPrefix:"oj",options:{data:null,overflow:"fit",pageSize:25,pageOptions:{layout:["auto"],type:"numbers",maxPageLinks:6,orientation:"horizontal"},loadMoreOptions:{maxCount:500},mode:"page",ready:null},Ja:{rna:"labelAccPaging",mna:"labelAccNavFirstPage",
nna:"labelAccNavLastPage",ona:"labelAccNavNextPage",qna:"labelAccNavPreviousPage",pna:"labelAccNavPage",sna:"labelLoadMore",tna:"labelLoadMoreMaxRows",C2:"labelNavInputPage",fQ:"labelNavInputPageMax",CMa:"labelNavInputPageSummary",H2:"msgItemRangeCurrent",kQ:"msgItemRangeCurrentSingle",I2:"msgItemRangeItems",Ina:"msgItemRangeOfAtLeast",Hna:"msgItemRangeOfApprox",Jna:"msgItemRangeOf",D3:"tipNavInputPage",Soa:"tipNavPageLink",F3:"tipNavNextPage",G3:"tipNavPreviousPage",C3:"tipNavFirstPage",E3:"tipNavLastPage",
Ou:"pageInvalid.summary",wMa:"pageInvalid.detail",b2:"dataInvalidType.summary",a2:"dataInvalidType.detail",Tma:"maxPageLinksInvalid.summary",Sma:"maxPageLinksInvalid.detail"},Ya:{YQ:"oj-component",Mh:"oj-active",Lu:"oj-clickable-icon-nocontext",dc:"oj-disabled",Ph:"oj-enabled",Pm:"oj-focus",jo:"oj-hover",Ze:"oj-selected"},Y:{Tna:"oj-pagingcontrol",V2:"oj-pagingcontrol-acc-label",W2:"oj-pagingcontrol-content",X2:"oj-pagingcontrol-loadmore",FH:"oj-pagingcontrol-loadmore-link",rQ:"oj-pagingcontrol-loadmore-max-rows",
GH:"oj-pagingcontrol-loadmore-range",sQ:"oj-pagingcontrol-loadmore-range-current",tQ:"oj-pagingcontrol-loadmore-range-max",Z2:"oj-pagingcontrol-nav",IH:"oj-pagingcontrol-nav-arrow",Y2:"oj-pagingcontrol-nav-arrow-section",wQ:"oj-pagingcontrol-nav-page",foa:"oj-pagingcontrol-nav-page-ellipsis",Vna:"oj-pagingcontrol-nav-dot",Una:"oj-pagingcontrol-nav-dot-bullet",eoa:"oj-pagingcontrol-nav-page-acc-label",b3:"oj-pagingcontrol-nav-label",a3:"oj-pagingcontrol-nav-input-section",Vu:"oj-pagingcontrol-nav-input",
$B:"oj-pagingcontrol-nav-input-max",aC:"oj-pagingcontrol-nav-input-summary",uQ:"oj-pagingcontrol-nav-input-summary-current",vQ:"oj-pagingcontrol-nav-input-summary-max",d3:"oj-pagingcontrol-nav-pages-section",c3:"oj-pagingcontrol-nav-pages-links",dy:"oj-pagingcontrol-nav-first",Wna:"oj-pagingcontrol-nav-first-acc-label",gy:"oj-pagingcontrol-nav-previous",goa:"oj-pagingcontrol-nav-previous-acc-label",fy:"oj-pagingcontrol-nav-next",boa:"oj-pagingcontrol-nav-next-acc-label",ey:"oj-pagingcontrol-nav-last",
Zna:"oj-pagingcontrol-nav-last-acc-label",Xna:"oj-pagingcontrol-nav-first-icon",hoa:"oj-pagingcontrol-nav-previous-icon",coa:"oj-pagingcontrol-nav-next-icon",$na:"oj-pagingcontrol-nav-last-icon",Yna:"oj-pagingcontrol-nav-first-vertical-icon",ioa:"oj-pagingcontrol-nav-previous-vertical-icon",doa:"oj-pagingcontrol-nav-next-vertical-icon",aoa:"oj-pagingcontrol-nav-last-vertical-icon",$u:"oj-component-icon",Dl:"oj-helper-hidden-accessible"},P1:"data-oj-pagenum",Hj:"enabled",gs:"disabled",Jj:"tabindex",
Um:{$r:"loadMore",pQ:"page"},Rh:{Cj:"auto",NB:"all",qH:"input",loa:"rangeText",Rna:"pages",J2:"nav"},Sna:6,mq:{EMa:"numbers",Lma:"dots"},firstPage:function(){return null!=this.Ob()?this.Tl(0,!1):this.Wy()},previousPage:function(){if(null!=this.Ob()){var a=this.Ig();if(0<a)return this.Tl(a-1,!1)}return this.Wy()},nextPage:function(){if(null!=this.Ob()){var a=this.Ig();if(this.cf()&&a+1<=this.af()-1||0>this.af()||!this.cf())return this.Tl(a+1,!1)}return this.Wy()},lastPage:function(){return null!=this.Ob()&&
0<this.af()?this.Tl(this.af()-1,!1):this.Wy()},page:function(a){return null!=this.Ob()&&(this.cf()&&a<=this.af()-1||0>this.af()||!this.cf())?this.Tl(a,!1):this.Wy()},loadNext:function(){return null!=this.Ob()?this.iza():this.Wy()},refresh:function(){this._super();this.Of()},getNodeBySubId:function(a){if(null==a)return this.element?this.element[0]:null;var b=a.subId,c=null;"oj-pagingcontrol-nav-input"===b?c=this.Kf().find("."+this.Y.Vu)[0]:"oj-pagingcontrol-nav-input-max"===b?c=this.Kf().find("."+
this.Y.$B)[0]:"oj-pagingcontrol-nav-input-summary"===b?c=this.Kf().find("."+this.Y.aC)[0]:"oj-pagingcontrol-nav-input-summary-current"===b?c=this.Kf().find("."+this.Y.uQ)[0]:"oj-pagingcontrol-nav-input-summary-max"===b?c=this.Kf().find("."+this.Y.vQ)[0]:"oj-pagingcontrol-nav-first"===b?c=this.Kf().find("."+this.Y.dy)[0]:"oj-pagingcontrol-nav-next"===b?c=this.Kf().find("."+this.Y.fy)[0]:"oj-pagingcontrol-nav-previous"===b?c=this.Kf().find("."+this.Y.gy)[0]:"oj-pagingcontrol-nav-last"===b?c=this.Kf().find("."+
this.Y.ey)[0]:"oj-pagingcontrol-nav-page"===b?(a=a.index,c=this.Kf().find("["+this.P1+"\x3d"+a+"]")[0]):"oj-pagingcontrol-load-more-link"===b?c=this.Kf().find("."+this.Y.FH)[0]:"oj-pagingcontrol-load-more-range"===b?c=this.Kf().find("."+this.Y.GH)[0]:"oj-pagingcontrol-load-more-range-current"===b?c=this.Kf().find("."+this.Y.sQ)[0]:"oj-pagingcontrol-load-more-range-max"===b?c=this.Kf().find("."+this.Y.tQ)[0]:"oj-pagingcontrol-load-more-max-rows"===b&&(c=this.Kf().find("."+this.Y.rQ)[0]);void 0===c&&
(c=null);return c},getSubIdByNode:function(a){return g(a).hasClass(this.Y.Vu)?{subId:"oj-pagingcontrol-nav-input"}:g(a).hasClass(this.Y.$B)?{subId:"oj-pagingcontrol-nav-input-max"}:g(a).hasClass(this.Y.aC)?{subId:"oj-pagingcontrol-nav-input-summary"}:g(a).hasClass(this.Y.uQ)?{subId:"oj-pagingcontrol-nav-input-summary-current"}:g(a).hasClass(this.Y.vQ)?{subId:"oj-pagingcontrol-nav-input-summary-max"}:g(a).hasClass(this.Y.dy)?{subId:"oj-pagingcontrol-nav-first"}:g(a).hasClass(this.Y.fy)?{subId:"oj-pagingcontrol-nav-next"}:
g(a).hasClass(this.Y.gy)?{subId:"oj-pagingcontrol-nav-previous"}:g(a).hasClass(this.Y.ey)?{subId:"oj-pagingcontrol-nav-last"}:g(a).hasClass(this.Y.wQ)?{subId:"oj-pagingcontrol-nav-page",index:g(a).attr(this.P1)}:g(a).hasClass(this.Y.FH)?{subId:"oj-pagingcontrol-load-more-link"}:g(a).hasClass(this.Y.GH)?{subId:"oj-pagingcontrol-load-more-range"}:g(a).hasClass(this.Y.sQ)?{subId:"oj-pagingcontrol-load-more-range-current"}:g(a).hasClass(this.Y.tQ)?{subId:"oj-pagingcontrol-load-more-range-max"}:g(a).hasClass(this.Y.rQ)?
{subId:"oj-pagingcontrol-load-more-max-rows"}:null},_ComponentCreate:function(){this._super();this.gw();this.TC();this.xn(this.Kf());this._on(this.xq)},Nh:function(){this._super();this.Dz();this.ada()},_destroy:function(){this.gp();this.PL();this.JC=!0},TC:function(){var a=this.options;this.element.addClass(this.Y.Tna);this.element.addClass(this.Ya.YQ);this.fsa();this.lsa();this.Iaa=a.mode;a.mode==this.Um.$r?(this.R5(),this.S5(),this.T5()):this.U5()},xq:{"mouseup .oj-pagingcontrol-loadmore-link":function(a){this.loadNext();
g(a.target).data("_mouseup",!0);a.preventDefault()},"click .oj-pagingcontrol-loadmore-link":function(a){g(a.target).data("_mouseup")?g(a.target).data("_mouseup",!1):this.loadNext();a.preventDefault()},"click .oj-pagingcontrol-nav-dot":function(b){if(!g(b.currentTarget).hasClass(this.Ya.dc)){var c=g(b.currentTarget).attr("data-oj-pagenum"),f=this;this.page(c).then(function(){f=null},function(b){var c=f.F(f.Ja.Ou);a.t.error(c+"\n"+b);f=null})}b.preventDefault()},"click .oj-pagingcontrol-nav-page":function(b){if(!g(b.currentTarget).hasClass(this.Ya.dc)){var c=
g(b.currentTarget).attr("data-oj-pagenum"),f=this;this.page(c).then(function(){f=null},function(b){var c=f.F(f.Ja.Ou);a.t.error(c+"\n"+b);f=null})}b.preventDefault()},"click .oj-pagingcontrol-nav-first":function(b){if(!g(b.currentTarget).hasClass(this.Ya.dc)){var c=this;this.firstPage().then(function(){c=null},function(b){var d=c.F(c.Ja.Ou);a.t.error(d+"\n"+b);c=null})}b.preventDefault()},"click .oj-pagingcontrol-nav-previous":function(b){if(!g(b.currentTarget).hasClass(this.Ya.dc)){var c=this;this.previousPage().then(function(){c=
null},function(b){var d=c.F(c.Ja.Ou);a.t.error(d+"\n"+b);c=null})}b.preventDefault()},"click .oj-pagingcontrol-nav-next":function(b){if(!g(b.currentTarget).hasClass(this.Ya.dc)){var c=this;this.nextPage().then(function(){c=null},function(b){var d=c.F(c.Ja.Ou);a.t.error(d+"\n"+b);c=null})}b.preventDefault()},"click .oj-pagingcontrol-nav-last":function(b){if(!g(b.currentTarget).hasClass(this.Ya.dc)){var c=this;this.lastPage().then(function(){c=null},function(b){var d=c.F(c.Ja.Ou);a.t.error(d+"\n"+b);
c=null})}b.preventDefault()},"keypress .oj-pagingcontrol-nav-input":function(a){13==a.which&&a.preventDefault()},"mousedown .oj-pagingcontrol-nav-first":function(a){g(a.currentTarget).hasClass(this.Ya.dc)||g(a.target).addClass(this.Ya.Mh);a.preventDefault()},"mousedown .oj-pagingcontrol-nav-previous":function(a){g(a.currentTarget).hasClass(this.Ya.dc)||g(a.target).addClass(this.Ya.Mh);a.preventDefault()},"mousedown .oj-pagingcontrol-nav-next":function(a){g(a.currentTarget).hasClass(this.Ya.dc)||g(a.target).addClass(this.Ya.Mh);
a.preventDefault()},"mousedown .oj-pagingcontrol-nav-last":function(a){g(a.currentTarget).hasClass(this.Ya.dc)||g(a.target).addClass(this.Ya.Mh);a.preventDefault()},"mouseup .oj-pagingcontrol-nav-first":function(a){g(a.target).removeClass(this.Ya.Mh);a.preventDefault()},"mouseup .oj-pagingcontrol-nav-previous":function(a){g(a.target).removeClass(this.Ya.Mh);a.preventDefault()},"mouseup .oj-pagingcontrol-nav-next":function(a){g(a.target).removeClass(this.Ya.Mh);a.preventDefault()},"mouseup .oj-pagingcontrol-nav-last":function(a){g(a.target).removeClass(this.Ya.Mh);
a.preventDefault()},"mouseleave .oj-pagingcontrol-nav-first":function(a){g(a.target).removeClass(this.Ya.Mh);a.preventDefault()},"mouseleave .oj-pagingcontrol-nav-previous":function(a){g(a.target).removeClass(this.Ya.Mh);a.preventDefault()},"mouseleave .oj-pagingcontrol-nav-next":function(a){g(a.target).removeClass(this.Ya.Mh);a.preventDefault()},"mouseleave .oj-pagingcontrol-nav-last":function(a){g(a.target).removeClass(this.Ya.Mh);a.preventDefault()}},Of:function(){this.i!=this.options.data&&(this.WR(),
this.ada());var a=0,b=0;null!=this.i&&(b=this.i.getStartItemIndex());null!=this.i&&0!=this.i.totalSize()&&0<=this.i.getEndItemIndex()&&(a=this.i.getEndItemIndex()-b+1);if(this.Iaa!=this.options.mode)this.Iaa=this.options.mode,this.options.mode==this.Um.$r?this.Jba(a,b):this.Kba(a,b);else if(this.options.mode==this.Um.$r){var c=this.Ob(),h=this.Uy();null!=c&&(b+a==c.totalSize()&&this.cf()||0==c.totalSize())?h.css("display","none"):this.Jba(a,b)}else this.Kba(a,b)},_setOption:function(a,b){this._superApply(arguments);
this.Tl(0,!0);if(this.options.mode!=this.Um.$r&&"pageOptions"==a){var c=this.Pl();null!=c&&(this.NL(c),this.PL(),c.empty());this.bra();this.U5();this.Dz()}this.Of()},WR:function(){null!=this.i&&this.gp();this.i=null},ara:function(){this.wR=this.vR=this.uR=null},bra:function(){this.zR=this.yR=this.xR=null},Ig:function(){var a=this.Ob(),b=0;null!=a&&(b=a.getPage());return b},Ob:function(){this.i||null==this.options.data||(this.i=this.options.data,this.gw());return this.i},yT:function(a,b){var c=0<=
b?b:0,h=g(document.createElement("span")),k=g(document.createElement("span"));this.options.mode==this.Um.$r?k.addClass(this.Y.sQ):k.addClass(this.Y.uQ);h.append(k);var l=this.Ob();if(null!=l&&null!=l.totalSize()&&null!=a){var m=this.F(this.Ja.kQ,{pageFrom:c}),m=parseInt(b,10)+parseInt(a,10),c=0<m?c+1:0;if(-1!=l.totalSize()){m=m>l.totalSize()?l.totalSize():m;if(c==m)m=this.F(this.Ja.kQ,{pageFrom:c});else{if(c>m)return h;m=this.F(this.Ja.H2,{pageFrom:c,pageTo:m})}var c=this.F(this.Ja.Jna),r=null;"atLeast"==
l.totalSizeConfidence()?r=this.F(this.Ja.Ina):"estimate"==l.totalSizeConfidence()&&(r=this.F(this.Ja.Hna));var t=g(document.createElement("span"));null==r?t.text(" "+c+" "):t.text(" "+r+" ");h.append(t);c=g(document.createElement("span"));this.options.mode==this.Um.$r?c.addClass(this.Y.tQ):c.addClass(this.Y.vQ);c.text(l.totalSize());h.append(c)}else m=0==a?this.F(this.Ja.kQ,{pageFrom:0}):this.F(this.Ja.H2,{pageFrom:c,pageTo:m});l=this.F(this.Ja.I2);c=g(document.createElement("span"));c.text(" "+l);
h.append(c);k.text(m)}return h},o8:function(){var a=this.options.pageOptions.maxPageLinks;this.options.pageOptions.type==this.mq.Lma?a=Number.MAX_VALUE:a||(a=this.Sna);return a},p8:function(a){var b=0;0<this.af()&&this.cf()?b=this.af():0<a?(a=this.Ob(),b=null==a||"atLeast"!=a.totalSizeConfidence()&&"estimate"!=a.totalSizeConfidence()?this.Ig()+2:this.af()+1):b=this.Ig()+1;return b},Wy:function(){return Promise.reject()},af:function(){var a=this.Ob(),b=0;null!=a&&(b=a.getPageCount());return-1<=b?b:
0},kU:function(){var a=g(document.activeElement);if(a.hasClass(this.Y.wQ)){var b=a.attr("data-oj-pagenum"),c=this;setTimeout(function(){0<=b&&c.Pl().find("div[data-oj-pagenum\x3d"+b+"]").focus();c=b=null},100)}else a.hasClass(this.Y.dy)?(c=this,setTimeout(function(){c.Pl().find("."+c.Y.dy).focus();c=null},100)):a.hasClass(this.Y.gy)?(c=this,setTimeout(function(){c.Pl().find("."+c.Y.gy).focus();c=null},100)):a.hasClass(this.Y.fy)?(c=this,setTimeout(function(){c.Pl().find("."+c.Y.fy).focus();c=null},
100)):a.hasClass(this.Y.ey)?(c=this,setTimeout(function(){c.Pl().find("."+c.Y.ey).focus();c=null},100)):a.hasClass(this.Y.Vu)&&(c=this,setTimeout(function(){c.Pl().find("."+c.Y.Vu).focus();c=null},100));this.Bz()},Cwa:function(a){a.page!=a.previousPage&&this.Bz()},Ps:function(){this.Tl(0,!1)},$J:function(){this.Bz()},nU:function(a){this.options.mode==this.Um.$r&&this.Ps(a)},lU:function(a){this.kV(a)?this.options.mode==this.Um.pQ?this.Tl(this.Ig(),!0):this.E$():this.Bz()},mU:function(a){if(this.options.mode==
this.Um.pQ){if(0<this.af()&&this.Ig()>this.af()-1){this.Tl(this.af()-1,!0);return}if(this.kV(a)){this.Tl(this.Ig(),!0);return}}else if(this.kV(a)){this.E$();return}this.Bz()},Rxa:function(b,c){if("value"==c.option){var f=c.value;if(f!=this.Ig()+1&&!isNaN(f)&&0<f){var f=Math.round(f),h=this;this.page(f-1).then(function(){h=null},function(b){var c=h.F(h.Ja.Ou);a.t.error(c+"\n"+b);h=null})}}},Tl:function(a,b){try{a=parseInt(a,10)}catch(c){return Promise.reject(c)}this.Wi=0;if(b)return this.LBa(a),Promise.resolve();
var h=this.Ob(),k=this;return new Promise(function(b,c){null!=h?(h.setPage(a,{pageSize:k.options.pageSize}).then(function(){b(null)},function(a){c(a)}),k=h=null):(k=null,b(null))})},iza:function(){var a=this.Ob(),b=this.options.pageSize;this.Wi=this.Wi?this.Wi+b:b;if(!this.cf()||a.totalSize()>this.Wi&&this.cf()){var c=this;return new Promise(function(h,k){a.fetch({startIndex:c.Wi,pageSize:b}).then(function(a){h(a)},function(){k(null)});c=a=null})}return Promise.resolve()},E$:function(){var a=this.Ob(),
b=this.options.pageSize;if(!this.cf()||a.totalSize()>this.Wi&&this.cf()){var c=this;return new Promise(function(h,k){a.fetch({startIndex:0,pageSize:c.Wi+b}).then(function(a){h(a)},function(){k(null)});c=a=null})}return Promise.resolve()},kV:function(a){if(null==a)return!1;var b=this.Ob(),c=b.getStartItemIndex();this.options.mode==this.Um.$r&&(c=0);var b=b.getEndItemIndex(),h;if(null!=a.index){if(h=a.index,h>=c&&h<=b)return!0}else if(null!=a.indexes){var k;for(k=0;k<a.indexes.length;k++)if(h=a.indexes[k],
h>=c&&h<=b)return!0}return!1},cf:function(){var a=this.Ob();return null!=a&&"actual"==a.totalSizeConfidence()?!0:!1},LBa:function(b){var c=this;this.xz||(this.$v=0,this.xz=Promise.resolve());this.$v++;this.dBa=b;this.xz=this.xz.then(function(){c.$v--;if(0==c.$v&&!c.JC){c.xz=void 0;var b=c.Ob();null!=b&&b.setPage(c.dBa,{pageSize:c.options.pageSize}).then(function(){c=b=null},function(b){c.$v--;0>=c.$v&&(c.xz=void 0,a.t.error(b),c=null)})}},function(b){c.$v--;0>=c.$v&&(c.xz=void 0,a.t.error(b),c=null)})},
Bz:function(){var b=this;this.jE||(this.wE=0,this.jE=Promise.resolve());this.wE++;this.jE=this.jE.then(function(){b.wE--;0!=b.wE||b.JC||(b.jE=void 0,b.Of(),b._trigger("ready"),b=null)},function(c){b.wE--;0==b.wE&&(b.jE=void 0,a.t.error(c),b=null)})},Jba:function(a,b){var c=this.Pl();null!=c&&c.empty();this.ara();this.R5();c=-1;null!=a&&(c=b+a);0>c||c<this.options.loadMoreOptions.maxCount?(this.S5(),this.T5(a,b)):this.msa()},Kba:function(a,b){var c=this.options.overflow;this.VBa(a,b);this.UBa();this.TBa();
this.XBa(a,b);this.WBa(a,b);this.SBa(a,b);if("fit"==c){var c=this.element.width(),h=this.B8(),k=this.OT(),g=this.Cva(),m=this.Bva(),r=null!=h?h[0].offsetWidth:0,t=null!=k?k[0].offsetWidth:0,k=null!=g?g.width():0,s=null!=m?m.width():0,r=r+t+s;r>c?r-k<=c?g.css("display","none"):r-k-s<=c?(null!=g&&g.css("display","none"),null!=m&&m.css("display","none")):(null!=g&&g.css("display","none"),null!=m&&m.css("display","none"),null!=h&&h.css("display","none")):0<r&&(null!=g&&g.css("display",""),null!=m&&m.css("display",
""),null!=h&&h.css("display",""))}},SBa:function(a){var b=this.options.pageSize,c=this.B8(),h=c.children("."+this.Y.dy);if(h&&0<h.length){var h=g(h[0]),k=this.F(this.Ja.C3);h.attr("title",k);0==this.Ig()?(h.addClass(this.Ya.dc),h.removeClass(this.Ya.Ph),h.attr("tabindex","-1")):(h.addClass(this.Ya.Ph),h.removeClass(this.Ya.dc),h.attr(this.Jj,"0"))}(h=c.children("."+this.Y.gy))&&0<h.length&&(h=g(h[0]),k=this.F(this.Ja.G3),h.attr("title",k),0==this.Ig()?(h.addClass(this.Ya.dc),h.removeClass(this.Ya.Ph),
h.attr(this.Jj,"-1")):(h.addClass(this.Ya.Ph),h.removeClass(this.Ya.dc),h.attr(this.Jj,"0")));(h=c.children("."+this.Y.ey))&&0<h.length&&(h=g(h[0]),k=this.F(this.Ja.E3),h.attr("title",k),this.Ig()==this.af()-1||0>=this.af()||!this.cf()?(h.addClass(this.Ya.dc),h.removeClass(this.Ya.Ph),h.attr(this.Jj,"-1")):(h.addClass(this.Ya.Ph),h.removeClass(this.Ya.dc),h.attr(this.Jj,"0")));(c=c.children("."+this.Y.fy))&&0<c.length&&(c=g(c[0]),h=this.F(this.Ja.F3),c.attr("title",h),this.Ig()==this.af()-1&&this.cf()||
0===this.af()||0>this.af()&&0===a||0>this.af()&&a<b?(c.addClass(this.Ya.dc),c.removeClass(this.Ya.Ph),c.attr(this.Jj,"-1")):(c.addClass(this.Ya.Ph),c.removeClass(this.Ya.dc),c.attr(this.Jj,"0")))},WBa:function(a,b){var c=this.Jo().find("."+this.Y.d3);null!=c&&0<c.length&&(c=g(c.get(0)),this.NL(c),c.empty(),this.V5(c,this.o8(),a,b))},UBa:function(){var a=this.OT();if(null!=a&&(a=a.children("."+this.Y.b3),null!=a&&0<a.length)){var a=g(a[0]),b=this.F(this.Ja.C2);a.text(b)}},TBa:function(){var a=this.Ava();
if(null!=a){var b=this.F(this.Ja.D3);a.attr("title",b);a.ojInputText("option","title",b)}},XBa:function(a,b){var c=this.Jo().children("."+this.Y.aC);if(null!=c&&0<c.length){var h=this.yT(a,b),c=g(c.get(0));c.empty();0<h.text().length&&(c.append("("),c.append(h),c.append(")"))}},VBa:function(a){a=this.p8(a);var b=this.Jo().find("."+this.Y.$B);if(null!=b&&0<b.length)if(b=g(b.get(0)),0<this.af()&&this.cf()){var c=this.F(this.Ja.fQ,{pageMax:a});b.text(c)}else b.empty();else c=this.OT(),null!=c&&0<this.af()&&
this.cf()&&a>=this.Ig()+1&&(b=g(document.createElement("span")),b.addClass(this.Y.$B),c.append(b),c=this.F(this.Ja.fQ,{pageMax:a}),b.text(c));b=this.Jo().find("."+this.Y.Vu);null!=b&&0<b.length&&(b=g(b.get(0)),b.ojInputText("option","validators",[{type:"numberRange",options:{min:1,max:a}}]),b.ojInputText("option","value",this.Ig()+1))},gw:function(){var b=this.Ob();if(null!=b){this.gp();this.vb=[];this.vb.push({eventType:a.bd.O.PAGE,eventHandler:this.Cwa.bind(this)});this.vb.push({eventType:a.bd.O.PAGECOUNT,
eventHandler:this.$J.bind(this)});this.vb.push({eventType:a.Ba.O.ADD,eventHandler:this.lU.bind(this)});this.vb.push({eventType:a.Ba.O.REMOVE,eventHandler:this.mU.bind(this)});this.vb.push({eventType:a.Ba.O.RESET,eventHandler:this.Ps.bind(this)});this.vb.push({eventType:a.Ba.O.REFRESH,eventHandler:this.$J.bind(this)});this.vb.push({eventType:a.Ba.O.SYNC,eventHandler:this.kU.bind(this)});this.vb.push({eventType:a.Ba.O.SORT,eventHandler:this.nU.bind(this)});var c,f;for(c=0;c<this.vb.length;c++)(f=b.on(this.vb[c].eventType,
this.vb[c].eventHandler))&&(this.vb[c].eventHandler=f)}},xn:function(b){if(!this.AK){var c=this;a.D.$k(b[0],function(){c.Bz()},50);this.AK=!0}},Dz:function(){if(a.D.jf()&&this.options.mode==this.Um.pQ){var b=this.Jo();if(null!=b){var e=this;if("vertical"==this.options.pageOptions.orientation){var f={recognizers:[[c.Swipe,{direction:c.DIRECTION_VERTICAL}]]};this.iU=b.rj(f).on("swipeup",function(a){a.preventDefault();e.nextPage()});this.fU=b.rj(f).on("swipedown",function(a){a.preventDefault();e.previousPage()})}else f=
{recognizers:[[c.Swipe,{direction:c.DIRECTION_HORIZONTAL}]]},this.gU=b.rj(f).on("swipeleft",function(a){a.preventDefault();e.nextPage()}),this.hU=b.rj(f).on("swiperight",function(a){a.preventDefault();e.previousPage()})}}},ada:function(){var a=this.Ig();0<a?this.Tl(a,!0):this.Tl(0,!0)},gp:function(){var a=this.Ob();if(null!=this.vb&&null!=a){var b;for(b=0;b<this.vb.length;b++)a.off(this.vb[b].eventType,this.vb[b].eventHandler)}},NL:function(a){var b=this;a.find("*").each(function(){b.Zu(this)});b=
null},PL:function(){a.D.jf()&&("vertical"==this.options.pageOptions.orientation?(null!=this.iU&&(this.iU.off("swipeup"),this.iU=null),null!=this.fU&&(this.fU.off("swipedown"),this.fU=null)):(null!=this.gU&&(this.gU.off("swipeleft"),this.gU=null),null!=this.hU&&(this.hU.off("swiperight"),this.hU=null)))},zy:function(a,b){var c=g(document.createElement("span"));c.addClass(b);c.addClass(this.Y.Dl);c.text(a);return c},fsa:function(){var a=this.Kf(),b=this.F(this.Ja.rna),b=this.zy(b,this.Y.V2),c=this.element.attr("id")+
"_oj_pgCtrl_acc_label";b.attr("id",c);a.append(b);return b},jsa:function(){var a=this.F(this.Ja.pna);return this.zy(a,this.Y.eoa)},gsa:function(){var a=this.F(this.Ja.mna);return this.zy(a,this.Y.Wna)},hsa:function(){var a=this.F(this.Ja.nna);return this.zy(a,this.Y.Zna)},isa:function(){var a=this.F(this.Ja.ona);return this.zy(a,this.Y.boa)},ksa:function(){var a=this.F(this.Ja.qna);return this.zy(a,this.Y.goa)},lsa:function(){var a=this.Kf(),b=g(document.createElement("div"));b.addClass(this.Y.W2);
var c=this.zva().attr("id");b.attr("role","navigation");b.attr("aria-labelledby",c);a.append(b);return b},R5:function(){var a=this.Pl(),b=g(document.createElement("div"));b.addClass(this.Y.X2);a.append(b);return b},S5:function(){var a=this.Uy(),b=g(document.createElement("a"));b.addClass(this.Y.FH);var c=this.F(this.Ja.sna);b.text(c);b.attr(this.Jj,"0");b.attr("href","#");a.append(b);return b},msa:function(){var a=this.Uy(),b=g(document.createElement("span"));b.addClass(this.Y.rQ);var c=this.F(this.Ja.tna,
{maxRows:this.options.loadMoreOptions.maxCount});b.text(c);a.append(b);return b},T5:function(a,b){var c=this.Uy(),h=g(document.createElement("span"));h.addClass(this.Y.GH);var k=this.yT(a,b);h.append(k);c.append(h);return h},U5:function(a,b){var c="vertical"==this.options.pageOptions.orientation?!0:!1,h="dots"==this.options.pageOptions.type?!0:!1,k=this.options.pageOptions.layout;null==k&&(k=[this.Rh.Cj]);var l=this.Pl(),m=g(document.createElement("div"));m.addClass(this.Y.Z2);l.append(m);if(-1!=
g.inArray(this.Rh.Cj,k)&&!h||-1!=g.inArray(this.Rh.NB,k)||-1!=g.inArray(this.Rh.qH,k)){l=g(document.createElement("div"));l.addClass(this.Y.a3);m.append(l);var r=g(document.createElement("label"));r.attr("for",this.element.attr("id")+"_nav_input");r.addClass(this.Y.b3);r.addClass("oj-label-inline");var t=this.F(this.Ja.C2);r.text(t);l.append(r);r=g(document.createElement("input"));r.addClass(this.Y.Vu);t=this.F(this.Ja.D3);this._focusable(this.element);r.attr("id",this.element.attr("id")+"_nav_input");
r.attr("title",t);r.attr(this.Jj,"0");r.val(this.Ig()+1);l.append(r);t=this.p8(a);if(0<this.af()&&this.cf()){var s=g(document.createElement("span"));s.addClass(this.Y.$B);var q=this.F(this.Ja.fQ,{pageMax:t});s.text(q);l.append(s)}r.ojInputText({displayOptions:{messages:["notewindow"],converterHint:["notewindow"],validatorHint:["notewindow"]},rootAttributes:{style:"width: auto; min-width: 0;"},optionChange:this.Rxa.bind(this),validators:[{type:"numberRange",options:{min:1,max:t}}]}).attr("data-oj-internal",
!0)}if(-1!=g.inArray(this.Rh.Cj,k)&&!h||-1!=g.inArray(this.Rh.NB,k)||-1!=g.inArray(this.Rh.loa,k))l=g(document.createElement("span")),l.addClass(this.Y.aC),r=this.yT(a,b),0<r.text().length&&(l.append("("),l.append(r),l.append(")")),m.append(l);l=g(document.createElement("div"));l.addClass(this.Y.Y2);m.append(l);if(-1!=g.inArray(this.Rh.Cj,k)&&!h||-1!=g.inArray(this.Rh.NB,k)||-1!=g.inArray(this.Rh.J2,k))r=g(document.createElement("a")),r.addClass(this.Y.IH),r.addClass(this.Y.dy),c?r.addClass(this.Y.Yna):
r.addClass(this.Y.Xna),r.addClass(this.Y.$u),r.addClass(this.Ya.Lu),r.addClass(this.Ya.dc),t=this.F(this.Ja.C3),this.We(r),this._focusable(r),r.attr("title",t),r.attr(this.Jj,"0"),r.attr("href","#"),r.attr("oncontextmenu","return false;"),t=this.gsa(),r.append(t),c&&r.css("display","block"),l.append(r),r=g(document.createElement("a")),r.addClass(this.Y.IH),r.addClass(this.Y.gy),c?r.addClass(this.Y.ioa):r.addClass(this.Y.hoa),r.addClass(this.Y.$u),r.addClass(this.Ya.Lu),r.addClass(this.Ya.dc),t=this.F(this.Ja.G3),
this.We(r),this._focusable(r),r.attr("title",t),r.attr(this.Jj,"0"),r.attr("href","#"),r.attr("oncontextmenu","return false;"),t=this.ksa(),r.append(t),c&&r.css("display","block"),l.append(r);if(-1!=g.inArray(this.Rh.Cj,k)||-1!=g.inArray(this.Rh.NB,k)||-1!=g.inArray(this.Rh.Rna,k))r=g(document.createElement("div")),r.addClass(this.Y.d3),l.append(r),this.V5(r,this.o8(),a,b);if(-1!=g.inArray(this.Rh.Cj,k)&&!h||-1!=g.inArray(this.Rh.NB,k)||-1!=g.inArray(this.Rh.J2,k))h=g(document.createElement("a")),
h.addClass(this.Y.IH),h.addClass(this.Y.fy),c?h.addClass(this.Y.doa):h.addClass(this.Y.coa),h.addClass(this.Y.$u),h.addClass(this.Ya.Lu),h.addClass(this.Ya.dc),k=this.F(this.Ja.F3),this.We(h),this._focusable(h),h.attr("title",k),h.attr(this.Jj,"0"),h.attr("href","#"),h.attr("oncontextmenu","return false;"),k=this.isa(),h.append(k),c&&h.css("display","block"),l.append(h),h=g(document.createElement("a")),h.addClass(this.Y.IH),h.addClass(this.Y.ey),c?h.addClass(this.Y.aoa):h.addClass(this.Y.$na),h.addClass(this.Y.$u),
h.addClass(this.Ya.Lu),h.addClass(this.Ya.dc),k=this.F(this.Ja.E3),this.We(h),this._focusable(h),h.attr("title",k),h.attr(this.Jj,"0"),h.attr("href","#"),h.attr("oncontextmenu","return false;"),k=this.hsa(),h.append(k),c&&h.css("display","block"),l.append(h);return m},V5:function(a,b,c){if(5>b){c=this.F(this.Ja.Tma);var h=this.F(this.Ja.Sma);throw Error(c+"\n"+h);}h=g(document.createElement("div"));h.addClass(this.Y.c3);a.append(h);var k=this.af(),l=this.Ig();a=this.options.pageSize;var m=b;b=[];
if(0<=l){if(this.cf()&&k<=m)for(b[0]=0,l=1;l<k;l++)b[l]=l;else{b.push(0);0!=l&&b.push(l);l!=k-1&&this.cf()&&b.push(k-1);var m=m-b.length,r=l-1,t=1;for(!this.cf()||l!=k-1&&l!=k-2||(t=0);m>t&&1<=r;)b.push(r),r--,m--;l+=1;for(-1==k&&(m=0<c&&c>=a?1:0);0<m&&(l<=k||-1==k);)b.push(l),l++,m--}b.sort(function(a,b){return a-b});for(l=0;l<b.length;l++)k=b[l],this.kS(h,k),l!=b.length-1&&k!=b[l+1]-1&&this.kS(h,-1);!this.cf()&&c>=a&&this.kS(h,-1)}return h},kS:function(a,b){var c=this.Ig(),h=null,k="rtl"===this.nd(),
l="vertical"==this.options.pageOptions.orientation?!0:!1,m="dots"==this.options.pageOptions.type?!0:!1;if(-1==b)h=g(document.createElement("span")),h.addClass(this.Y.foa),h.text("...");else{c==b?(h=g(document.createElement("div")),h.addClass(this.Ya.Ze),h.addClass(this.Ya.Mh),h.addClass(this.Ya.dc),h.removeClass(this.Ya.Ph)):(h=g(document.createElement("a")),h.removeClass(this.Ya.Ze),h.removeClass(this.Ya.Mh),h.removeClass(this.Ya.dc),h.addClass(this.Ya.Ph),h.attr("href","#"));h.attr("data-oj-pagenum",
b);m?h.addClass(this.Y.Vna):h.addClass(this.Y.wQ);var r=this.F(this.Ja.Soa,{pageNum:(b+1).toString()});this.We(h);this._focusable(h);h.attr("title",r);h.attr(this.Jj,"0");h.attr("oncontextmenu","return false;");r=this.jsa();h.append(r);r=g(document.createElement("span"));r.append((b+1).toString());m&&(r.addClass(this.Y.Una),this.We(r),c==b&&(r.addClass(this.Ya.Ze),r.addClass(this.Ya.Mh)));r.attr("dir",k?"rtl":"ltr");h.append(r);this.We(h);l&&h.css("display","block")}a.append(h);return h},zva:function(){var a=
this.Kf(),b=null;a&&(b=a.find("."+this.Y.V2))&&0<b.length&&(b=g(b.get(0)));return b},Kf:function(){return g(this.element)},Pl:function(){if(!this.L4){var a=this.Kf(),b=null;a&&(b=a.find("."+this.Y.W2))&&0<b.length&&(this.L4=g(b.get(0)))}return this.L4},Uy:function(){if(!this.uR){var a=this.Pl(),b=null;a&&(b=a.children("."+this.Y.X2))&&0<b.length&&(this.uR=g(b.get(0)))}return this.uR},bNa:function(){if(!this.vR){var a=this.Uy(),b=null;a&&(b=a.children("."+this.Y.FH))&&0<b.length&&(this.vR=g(b.get(0)))}return this.vR},
cNa:function(){if(!this.wR){var a=this.Uy(),b=null;a&&(b=a.children("."+this.Y.GH))&&0<b.length&&(this.wR=g(b.get(0)))}return this.wR},Jo:function(){if(!this.xR){var a=this.Pl(),b=null;a&&(b=a.children("."+this.Y.Z2))&&0<b.length&&(this.xR=g(b.get(0)))}return this.xR},Ava:function(){if(!this.yR){var a=this.Jo(),b=null;a&&(b=a.find("."+this.Y.Vu))&&0<b.length&&(this.yR=g(b.get(0)))}return this.yR},Bva:function(){if(!this.zR){var a=this.Jo(),b=null;a&&(b=a.find("."+this.Y.aC))&&0<b.length&&(this.zR=
g(b.get(0)))}return this.zR},Cva:function(){var a=this.Jo(),b=null;a&&(b=a.find("."+this.Y.c3))&&0<b.length&&(b=g(b.get(0)));return b},B8:function(){var a=this.Jo(),b=null;if(a)if((b=a.find("."+this.Y.Y2))&&0<b.length)b=g(b.get(0));else return null;return b},OT:function(){var a=this.Jo(),b=null;if(a)if((b=a.find("."+this.Y.a3))&&0<b.length)b=g(b.get(0));else return null;return b}})})();a.Components.Xa("ojPagingControl","baseComponent",{properties:{data:{},loadMoreOptions:{type:"Object\x3cstring, number\x3e"},
mode:{type:"string"},overflow:{type:"string"},pageOptions:{type:"Object\x3cstring, Array|number\x3e"},pageSize:{type:"number"}},methods:{firstPage:{},getNodeBySubId:{},getSubIdByNode:{},lastPage:{},loadNext:{},nextPage:{},page:{},previousPage:{},refresh:{}},extension:{_widgetName:"ojPagingControl"}});a.Components.register("oj-paging-control",a.Components.getMetadata("ojPagingControl"))});